package com.sc.nft.entity.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sc.nft.enums.SaasTaskParticipatorEnum;
import com.sc.nft.enums.SaasTaskRestEnum;
import com.sc.nft.enums.SaasTaskVisibleEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;
@Data
public class SaasTaskDetailsVO {
    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "任务名字")
    private String taskName;

    @ApiModelProperty(value = "任务icon")
    private String taskIcon;


    @ApiModelProperty(value = "任务重置类型")
    private SaasTaskRestEnum taskRest;

    @ApiModelProperty(value = "任务重置类型描述")
    private String taskRestName;

    @ApiModelProperty(value = "任务完成总次数")
    private Integer taskTotalSum;

    @ApiModelProperty(value = "任务每个人最大完成上限")
    private Integer taskEveryoneSum;

    @ApiModelProperty(value = "是否是首次参与,目前只用到了熔炼,意思就是是不是从注册开始第一次熔炼")
    private Boolean firstParticipation;

    @ApiModelProperty(value = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date taskStart;

    @ApiModelProperty(value = "结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date taskEnd;

    @ApiModelProperty(value = "任务条件的生效位置")
    private List<SaasTaskMeetConditionsLocationVO> saasTaskMeetConditionsLocation;

    @ApiModelProperty(value = "任务参与者 1:无门槛  2:持有指定藏品")
    private SaasTaskParticipatorEnum taskParticipator;

    @ApiModelProperty(value = "可见对象  1:所有人 2:DAO主理人网体")
    private SaasTaskVisibleEnum taskVisible;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "任务条件详情")
    private SaasTaskDetailsConditionVO saasTaskDetailsConditionVO;

    @ApiModelProperty(value = "持有任意的藏品,只有在taskParticipator为持有指定藏品的时候才会有效")
    private List<SaasTaskDetailsCollectionVO> saasTaskDetailsCollections;

    @ApiModelProperty(value = "dao网体 只有在taskParticipator为DAO主理人网体才会有效")
    private SaasTaskDetailsCreatorVO saasTaskDetailsCreatorVO;

    public void setTaskRest(SaasTaskRestEnum taskRest) {
        this.taskRest = taskRest;
        this.taskRestName = taskRest.getDesc();
    }
}
